package orm.litchi.service;

import orm.litchi.mapper.UserMapper;
import orm.litchi.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImp implements UserService {

    @Autowired
    UserMapper userMapperImp;

    @Override
    public List<User> getAllUser(Map map) {
        return userMapperImp.selectAll();
    }

    @Override
    public List<User> getAllUser() {
        return userMapperImp.selectAll();
    }

    @Override
    public List<User> getUserLike(String userName) {
        return userMapperImp.getUserLike(userName);
    }

    @Override
    public Integer insertUser(User user) {
        return userMapperImp.insert(user);
    }

    @Override
    public User getUserByID(Integer id) {
        return userMapperImp.getUserByID(id);
    }
}
